package cn.burnit.utils;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * 数据库连接封装
 */
public class ConnectUtils {
    public static void getDriver() {
        try {
            Class.forName("com.mysql.jdbc.Driver");
            System.out.println("数据库驱动加载成功 ！");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }

    public static Connection getConnection() throws SQLException {
        return DriverManager.getConnection("jdbc:mysql:///librarymanagement?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8", "root", "111111");
    }
}
